package top.shenluw.demo.querydsl;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;

import java.util.List;

/**
 * @author Shenluw
 * 创建日期：2018/9/28 17:11
 */
public interface AnimalRepo extends JpaRepository<Animal, Integer>, QuerydslPredicateExecutor<Animal> {

	@Query("select a from Animal as a where bitand(a.age,  ?2) = ?1")
	List<Animal> findAllByAge(int age, int bit);

}
